;Assembler header file for Window
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:07:20 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk; Simon Middleton, Uniqueway Ltd, 18 Aug 1996

        [       :LNOT: :DEF: Window_Hdr
        GBLS    Window_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_Toolbox
        GBLS    Get_Toolbox
        ]
        [       :LNOT: :DEF: Toolbox_Hdr
Get_Toolbox                     SETS    "GET oslib/Toolbox.Hdr"
        |
Get_Toolbox                     SETS    ""
        ]
        $Get_Toolbox

        [       :LNOT: :DEF: Get_KeyboardShortcut
        GBLS    Get_KeyboardShortcut
        ]
        [       :LNOT: :DEF: KeyboardShortcut_Hdr
Get_KeyboardShortcut            SETS    "GET oslib/KeyboardShortcut.Hdr"
        |
Get_KeyboardShortcut            SETS    ""
        ]
        $Get_KeyboardShortcut

        [       :LNOT: :DEF: Get_Gadget
        GBLS    Get_Gadget
        ]
        [       :LNOT: :DEF: Gadget_Hdr
Get_Gadget                      SETS    "GET oslib/Gadget.Hdr"
        |
Get_Gadget                      SETS    ""
        ]
        $Get_Gadget

;Symbols for constants
Class_Window                    *       &82880
Error_WindowAllocFailed         *       &80A901
Error_WindowShortBuffer         *       &80A902
Error_WindowBadVersion          *       &80A903
Error_WindowInvalidFlags        *       &80A904
Error_WindowTasksActive         *       &80A905
Error_WindowNoSuchTask          *       &80A911
Error_WindowNoSuchMethod        *       &80A912
Error_WindowNoSuchMiscOpMethod  *       &80A913
Error_WindowInvalidComponentID  *       &80A914
Error_WindowDuplicateComponentID *       &80A915
Error_WindowInvalidGadgetType   *       &80A920
Window_GenerateAboutToBeShown   *       &1
Window_AutoOpen                 *       &2
Window_AutoClose                *       &4
Window_GenerateDialogueCompleted *       &8
Window_IsToolBar                *       &10
Window_NoFocus                  *       -1
Window_SetFocusToWindow         *       -2
Action_WindowAboutToBeShown     *       &82880
Action_WindowDialogueCompleted  *       &82890
Window_ToolBarIBL               *       &1
Window_ToolBarITL               *       &2
Window_ToolBarEBL               *       &4
Window_ToolBarETL               *       &8
Window_ClickAdjust              *       &1
Window_ClickMenu                *       &2
Window_ClickSelect              *       &4
Window_ClickNotToolbox          *       &100

;Symbols for structure offsets and sizes
                                ^       0
                                #       Bits
Window_Flags                    *       @

                                ^       0
                                #       Bits
Window_GadgetFlags              *       @

                                ^       0
Window_IconData_indirected_text_text #       Toolbox_MsgReference
Window_IconData_indirected_text_validation #       Toolbox_StringReference
Window_IconData_indirected_text_size #       Int
Window_IconData                 *       @

                                ^       0
Window_Window_visible           #       OS_Box
Window_Window_xscroll           #       Int
Window_Window_yscroll           #       Int
Window_Window_next              #       Wimp_W
Window_Window_flags             #       Wimp_WindowFlags
Window_Window_title_fg          #       Wimp_Colour
Window_Window_title_bg          #       Wimp_Colour
Window_Window_work_fg           #       Wimp_Colour
Window_Window_work_bg           #       Wimp_Colour
Window_Window_scroll_outer      #       Wimp_Colour
Window_Window_scroll_inner      #       Wimp_Colour
Window_Window_highlight_bg      #       Wimp_Colour
Window_Window_extra_flags       #       Wimp_ExtraWindowFlags
Window_Window_extent            #       OS_Box
Window_Window_title_flags       #       Wimp_IconFlags
Window_Window_work_flags        #       Wimp_IconFlags
Window_Window_sprite_area       #       Toolbox_SpriteAreaReference
Window_Window_xmin              #       Short
Window_Window_ymin              #       Short
Window_Window_title_data        #       Window_IconData
Window_Window_icon_count        #       Int
Window_Window                   *       @

                                ^       0
Window_Object_flags             #       Window_Flags
Window_Object_help_message      #       Toolbox_MsgReference
Window_Object_help_limit        #       Int
Window_Object_sprite_name       #       Toolbox_StringReference
Window_Object_pointer_limit     #       Int
Window_Object_hotspot           #       OS_Coord
Window_Object_menu_name         #       Toolbox_StringReference
Window_Object_shortcut_count    #       Int
Window_Object_shortcuts         #       Toolbox_ObjectOffset
Window_Object_gadget_count      #       Int
Window_Object_gadgets           #       Toolbox_ObjectOffset
Window_Object_default_focus     #       Toolbox_C
Window_Object_show_action       #       Bits
Window_Object_hide_action       #       Bits
Window_Object_toolbar_ibl       #       Toolbox_StringReference
Window_Object_toolbar_itl       #       Toolbox_StringReference
Window_Object_toolbar_ebl       #       Toolbox_StringReference
Window_Object_toolbar_etl       #       Toolbox_StringReference
Window_Object_window            #       Window_Window
Window_Object_data              #       Int
Window_Object                   *       @
        
        MACRO
$label                          Window_Object_MEMBERS
$label._flags                   #       Window_Flags
$label._help_message            #       Toolbox_MsgReference
$label._help_limit              #       Int
$label._sprite_name             #       Toolbox_StringReference
$label._pointer_limit           #       Int
$label._hotspot                 #       OS_Coord
$label._menu_name               #       Toolbox_StringReference
$label._shortcut_count          #       Int
$label._shortcuts               #       Toolbox_ObjectOffset
$label._gadget_count            #       Int
$label._gadgets                 #       Toolbox_ObjectOffset
$label._default_focus           #       Toolbox_C
$label._show_action             #       Bits
$label._hide_action             #       Bits
$label._toolbar_ibl             #       Toolbox_StringReference
$label._toolbar_itl             #       Toolbox_StringReference
$label._toolbar_ebl             #       Toolbox_StringReference
$label._toolbar_etl             #       Toolbox_StringReference
$label._window                  #       Window_Window
        MEND
        
                                ^       0
Window_ObjectBase               Window_Object_MEMBERS
Window_ObjectBase               *       @

                                ^       0
Window_ObjectTemplate           Toolbox_ResourceFileObject_MEMBERS
Window_ObjectTemplate_objectflags #       Window_Flags
Window_ObjectTemplate_help_message #       Toolbox_MsgReference
Window_ObjectTemplate_help_limit #       Int
Window_ObjectTemplate_sprite_name #       Toolbox_StringReference
Window_ObjectTemplate_pointer_limit #       Int
Window_ObjectTemplate_hotspot   #       OS_Coord
Window_ObjectTemplate_menu_name #       Toolbox_StringReference
Window_ObjectTemplate_shortcut_count #       Int
Window_ObjectTemplate_shortcuts #       Toolbox_ObjectOffset
Window_ObjectTemplate_gadget_count #       Int
Window_ObjectTemplate_gadgets   #       Toolbox_ObjectOffset
Window_ObjectTemplate_default_focus #       Toolbox_C
Window_ObjectTemplate_show_action #       Bits
Window_ObjectTemplate_hide_action #       Bits
Window_ObjectTemplate_toolbar_ibl #       Toolbox_StringReference
Window_ObjectTemplate_toolbar_itl #       Toolbox_StringReference
Window_ObjectTemplate_toolbar_ebl #       Toolbox_StringReference
Window_ObjectTemplate_toolbar_etl #       Toolbox_StringReference
Window_ObjectTemplate_window    #       Window_Window
Window_ObjectTemplate_data      #       Int
Window_ObjectTemplate           *       @
        
        MACRO
$label                          Window_ObjectTemplate_MEMBERS
$label                          Toolbox_ResourceFileObject_MEMBERS
$label._objectflags             #       Window_Flags
$label._help_message            #       Toolbox_MsgReference
$label._help_limit              #       Int
$label._sprite_name             #       Toolbox_StringReference
$label._pointer_limit           #       Int
$label._hotspot                 #       OS_Coord
$label._menu_name               #       Toolbox_StringReference
$label._shortcut_count          #       Int
$label._shortcuts               #       Toolbox_ObjectOffset
$label._gadget_count            #       Int
$label._gadgets                 #       Toolbox_ObjectOffset
$label._default_focus           #       Toolbox_C
$label._show_action             #       Bits
$label._hide_action             #       Bits
$label._toolbar_ibl             #       Toolbox_StringReference
$label._toolbar_itl             #       Toolbox_StringReference
$label._toolbar_ebl             #       Toolbox_StringReference
$label._toolbar_etl             #       Toolbox_StringReference
$label._window                  #       Window_Window
        MEND
        
                                ^       0
Window_ObjectTemplateBase       Window_ObjectTemplate_MEMBERS
Window_ObjectTemplateBase       *       @

Window_Full                     *       Toolbox_Full

                                ^       0
Window_ActionShowObject_visible #       OS_Box
Window_ActionShowObject_xscroll #       Int
Window_ActionShowObject_yscroll #       Int
Window_ActionShowObject_next    #       Wimp_W
Window_ActionShowObject         *       @

                                ^       0
Window_ActionAboutToBeShown_tag #       Toolbox_PositionTag
Window_ActionAboutToBeShown_position *       @
Window_ActionAboutToBeShown_position_top_left #       OS_Coord
                                ^       Window_ActionAboutToBeShown_position
Window_ActionAboutToBeShown_position_full #       Window_Full
Window_ActionAboutToBeShown     *       @

                                ^       0
Window_ActionAboutToBeShownBlock Toolbox_ActionHeader_MEMBERS
Window_ActionAboutToBeShownBlock_tag #       Toolbox_PositionTag
Window_ActionAboutToBeShownBlock_position *       @
Window_ActionAboutToBeShownBlock_position_top_left #       OS_Coord
                                ^       Window_ActionAboutToBeShownBlock_position
Window_ActionAboutToBeShownBlock_position_full #       Window_Full
Window_ActionAboutToBeShownBlock *       @

Window_ActionDialogueCompletedBlock *       Toolbox_ActionHeaderBase

                                ^       0
                                #       Bits
Window_ToolBarFlags             *       @

                                ^       0
                                #       Bits
Window_MouseState               *       @


;Symbols for SWI's and SWI reason codes
XWindow_ClassSWI                *       &A2880
Window_ClassSWI                 *       &82880

XWindow_PostFilter              *       &A2881
Window_PostFilter               *       &82881

XWindow_PreFilter               *       &A2882
Window_PreFilter                *       &82882

XWindow_GetPointerInfo          *       &A2883
Window_GetPointerInfo           *       &82883
   ;Entry
   ;  R0 = flags (Bits)
   ;Exit
   ;  R0 = x (Int)
   ;  R1 = y (Int)
   ;  R2 = state (Window_MouseState)
   ;  R3 = obj (Toolbox_O)
   ;  R4 = cmp (Toolbox_C)

XWindow_WimpToToolbox           *       &A2884
Window_WimpToToolbox            *       &82884
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = w (Wimp_W)
   ;  R2 = i (Wimp_I)
   ;Exit
   ;  R0 = obj (Toolbox_O)
   ;  R1 = cmp (Toolbox_C)

XWindow_RegisterExternal        *       &A2885
Window_RegisterExternal         *       &82885
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 -> types (Gadget_ExtensionList)
   ;  R2 = handler_swi_number (Int)

XWindow_DeregisterExternal      *       &A2886
Window_DeregisterExternal       *       &82886
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = type (Int)
   ;  R2 = handler_swi_number (Int)

XWindow_RegisterFilter          *       &A2888
Window_RegisterFilter           *       &82888

XWindow_DeregisterFilter        *       &A2889
Window_DeregisterFilter         *       &82889

XWindow_EnumerateGadgets        *       &A288A
Window_EnumerateGadgets         *       &8288A

XWindow_GadgetGetIconList       *       &A288B
Window_GadgetGetIconList        *       &8288B

XWindow_ExtractGadgetInfo       *       &A28BE
Window_ExtractGadgetInfo        *       &828BE
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 -> object (Toolbox_ResourceFileObject)
   ;  R2 = cmp (Toolbox_C)
   ;Exit
   ;  R0 -> gadget (Gadget_Object)
   ;  R1 = size (Int)

XWindow_PlotGadget              *       &A28BF
Window_PlotGadget               *       &828BF

Window_GetWimpHandle            *       &0
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &0
   ;Exit
   ;  R0 = w (Wimp_W)

Window_AddGadget                *       &1
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &1
   ;  R3 -> object (Gadget_Object)
   ;Exit
   ;  R0 = gadget (Toolbox_C)

Window_RemoveGadget             *       &2
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &2
   ;  R3 = gadget (Toolbox_C)

Window_SetMenu                  *       &3
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &3
   ;  R3 = menu (Toolbox_O)

Window_GetMenu                  *       &4
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &4
   ;Exit
   ;  R0 = menu (Toolbox_O)

Window_SetPointer               *       &5
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &5
   ;  R3 -> sprite_name (String)
   ;  R4 = xhotspot (Int)
   ;  R5 = yhotspot (Int)

Window_GetPointer               *       &6
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &6
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)
   ;  R5 = xhotspot (Int)
   ;  R6 = yhotspot (Int)

Window_SetHelpMessage           *       &7
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &7
   ;  R3 -> help (String)

Window_GetHelpMessage           *       &8
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &8
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

Window_AddKeyboardShortcuts     *       &9
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &9
   ;  R3 = add_count (Int)
   ;  R4 -> shortcuts (KeyboardShortcut_Object)

Window_RemoveKeyboardShortcuts  *       &A
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &A
   ;  R3 = remove_count (Int)
   ;  R4 -> shortcuts (KeyboardShortcut_Object)

Window_SetTitle                 *       &B
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &B
   ;  R3 -> title (String)

Window_GetTitle                 *       &C
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &C
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R4 = used (Int)

Window_SetDefaultFocus          *       &D
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &D
   ;  R3 = focus (Toolbox_C)

Window_GetDefaultFocus          *       &E
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &E
   ;Exit
   ;  R0 = focus (Toolbox_C)

Window_SetExtent                *       &F
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &F
   ;  R3 -> extent (OS_Box)

Window_GetExtent                *       &10
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &10
   ;  R3 = extent (pointer to OS_Box)

Window_ForceRedraw              *       &11
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &11
   ;  R3 -> redraw (OS_Box)

Window_SetToolBars              *       &12
   ;Entry
   ;  R0 = flags (Window_ToolBarFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &12
   ;  R3 = ibl (Toolbox_O)
   ;  R4 = itl (Toolbox_O)
   ;  R5 = ebl (Toolbox_O)
   ;  R6 = etl (Toolbox_O)

Window_GetToolBars              *       &13
   ;Entry
   ;  R0 = flags (Window_ToolBarFlags)
   ;  R1 = window (Toolbox_O)
   ;  R2 = &13
   ;Exit
   ;  R0 = ibl (Toolbox_O)
   ;  R1 = itl (Toolbox_O)
   ;  R2 = ebl (Toolbox_O)
   ;  R3 = etl (Toolbox_O)

Service_WindowModuleStarting    *       &82881
   ;Entry
   ;  R1 = &82881

Service_WindowModuleDying       *       &82882
   ;Entry
   ;  R1 = &82882

Service_GadgetRegistered        *       &82883
   ;Entry
   ;  R0 = type (Int)
   ;  R1 = &82883
   ;  R2 = handler_swi_number (Int)
   ;  R3 = feature_mask (Bits)

Service_GadgetDeregistered      *       &82884
   ;Entry
   ;  R0 = type (Int)
   ;  R1 = &82884
   ;  R2 = handler_swi_number (Int)

        ]
        END
